comparison of if else vs ternary operator